<?php
class Personaladdress_Model_Insertuserdata implements Personaladdress_Model_Mainable{
    
    private $core_controller_notnull;
    private $core_controller_csrftoken;
    
    private $excepted_result = 1;
    private $actual_result;
    
    private $personaladdress_data_insertuserdata;
    
    public function main(array $variables = null) {
        $this->core_controller_notnull = new Core_Controller_Notnull;
        $this->core_controller_csrftoken = new Core_Controller_Csrftoken;
        
        $this->core_controller_notnull->main($variables);
        $this->core_controller_csrftoken->main($variables['post']);
        
        $this->personaladdress_data_insertuserdata = new Personaladdress_Data_Insertuserdata;
        $this->actual_result = $this->personaladdress_data_insertuserdata->main($variables);
        if(
                $this->actual_result == $this->excepted_result
                ){
            header("Location: ".SITE_ROOT."dane-teleadresowe.html");
        }
        else {
            header("Location: ".SITE_ROOT."dane-teleadresowe.html");
        }
    }

}
